<div class="{{CSS_PREFIX}}weekday-schedules {{collapsed}}"style="top:{{@root.scheduleContainerTop}}px;">
    {{#each matrices ~}}
    {{#each this ~}} {{! matrix }}
    {{#each this ~}} {{! column }}
    {{#if this ~}} {{! viewmodel }}
    <div data-id="{{stamp model}}"
        class="{{CSS_PREFIX}}weekday-schedule-block
            {{#if exceedLeft}} {{CSS_PREFIX}}weekday-exceed-left{{/if}}
            {{#if exceedRight}} {{CSS_PREFIX}}weekday-exceed-right{{/if}}"
        style="top:{{multiply top @root.scheduleBlockHeight}}px;
                left:{{grid-left this @root.dates}}%;
                width:{{grid-width this @root.dates}}%">
        <div data-schedule-id="{{model.id}}" data-calendar-id="{{model.calendarId}}" class="{{CSS_PREFIX}}weekday-schedule {{#if model.isFocused}}{{CSS_PREFIX}}weekday-schedule-focused {{/if}}"
            style="height:{{@root.scheduleHeight}}px; line-height:{{@root.scheduleHeight}}px; border-radius: {{@root.styles.borderRadius}};
                {{#if model.isFocused}}
                    color: #ffffff; background-color:{{model.color}}; border-color:{{model.color}};
                {{else}}
                    color:{{model.color}}; background-color:{{model.bgColor}}; border-color:{{model.borderColor}};
                {{/if}}
            {{model.customStyle}}">
            <span class="{{CSS_PREFIX}}weekday-schedule-title" title="{{model.title}}">{{{schedule-tmpl model}}}</span>
            {{#unless (or @root.isReadOnly model.isReadOnly)}}<span class="{{CSS_PREFIX}}weekday-resize-handle handle-y" style="line-height:{{@root.scheduleHeight}}px;">&nbsp;</span>{{/unless}}
        </div>
    </div>
    {{/if ~}}
    {{/each ~}}
    {{/each ~}}
    {{/each ~}}
</div>
